3.1.78 \(\int (d+e x) (a+b \log (c x^n))^2 \, dx\) [78]

Optimal. Leaf size=101 \[ -2 a b d n x+2 b^2 d n^2 x+\frac {1}{4} b^2 e n^2 x^2-2 b^2 d n x \log \left (c x^n\right )-\frac {1}{2} b e n x^2 \left (a+b \log \left (c x^n\right )\right )+d x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e x^2 \left (a+b \log \left (c x^n\right )\right )^2 \]

[Out]

-2*a*b*d*n*x+2*b^2*d*n^2*x+1/4*b^2*e*n^2*x^2-2*b^2*d*n*x*ln(c*x^n)-1/2*b*e*n*x^2*(a+b*ln(c*x^n))+d*x*(a+b*ln(c
*x^n))^2+1/2*e*x^2*(a+b*ln(c*x^n))^2

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {2367, 2333, 2332, 2342, 2341} \begin {gather*} d x \left (a+b \log \left (c x^n\right )\right )^2-\frac {1}{2} b e n x^2 \left (a+b \log \left (c x^n\right )\right )+\frac {1}{2} e x^2 \left (a+b \log \left (c x^n\right )\right )^2-2 a b d n x-2 b^2 d n x \log \left (c x^n\right )+2 b^2 d n^2 x+\frac {1}{4} b^2 e n^2 x^2 \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d + e*x)*(a + b*Log[c*x^n])^2,x]

[Out]

-2*a*b*d*n*x + 2*b^2*d*n^2*x + (b^2*e*n^2*x^2)/4 - 2*b^2*d*n*x*Log[c*x^n] - (b*e*n*x^2*(a + b*Log[c*x^n]))/2 +
 d*x*(a + b*Log[c*x^n])^2 + (e*x^2*(a + b*Log[c*x^n])^2)/2

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2333

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2367

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = Expand
Integrand[(a + b*Log[c*x^n])^p, (d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n, p, q, r}
, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[r]))

Rubi steps

\begin {align*} \int (d+e x) \left (a+b \log \left (c x^n\right )\right )^2 \, dx &=\int \left (d \left (a+b \log \left (c x^n\right )\right )^2+e x \left (a+b \log \left (c x^n\right )\right )^2\right ) \, dx\\ &=d \int \left (a+b \log \left (c x^n\right )\right )^2 \, dx+e \int x \left (a+b \log \left (c x^n\right )\right )^2 \, dx\\ &=d x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e x^2 \left (a+b \log \left (c x^n\right )\right )^2-(2 b d n) \int \left (a+b \log \left (c x^n\right )\right ) \, dx-(b e n) \int x \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=-2 a b d n x+\frac {1}{4} b^2 e n^2 x^2-\frac {1}{2} b e n x^2 \left (a+b \log \left (c x^n\right )\right )+d x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e x^2 \left (a+b \log \left (c x^n\right )\right )^2-\left (2 b^2 d n\right ) \int \log \left (c x^n\right ) \, dx\\ &=-2 a b d n x+2 b^2 d n^2 x+\frac {1}{4} b^2 e n^2 x^2-2 b^2 d n x \log \left (c x^n\right )-\frac {1}{2} b e n x^2 \left (a+b \log \left (c x^n\right )\right )+d x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e x^2 \left (a+b \log \left (c x^n\right )\right )^2\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 77, normalized size = 0.76 \begin {gather*} \frac {1}{4} x \left (b e n x \left (-2 a+b n-2 b \log \left (c x^n\right )\right )+4 d \left (a+b \log \left (c x^n\right )\right )^2+2 e x \left (a+b \log \left (c x^n\right )\right )^2-8 b d n \left (a-b n+b \log \left (c x^n\right )\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x)*(a + b*Log[c*x^n])^2,x]

[Out]

(x*(b*e*n*x*(-2*a + b*n - 2*b*Log[c*x^n]) + 4*d*(a + b*Log[c*x^n])^2 + 2*e*x*(a + b*Log[c*x^n])^2 - 8*b*d*n*(a
 - b*n + b*Log[c*x^n])))/4

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.15, size = 1545, normalized size = 15.30

method result size
risch \(\text {Expression too large to display}\) \(1545\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)*(a+b*ln(c*x^n))^2,x,method=_RETURNVERBOSE)

[Out]

1/2*a^2*e*x^2+x*a^2*d+1/2*I*Pi*a*b*e*x^2*csgn(I*x^n)*csgn(I*c*x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n)*csgn(I*c*x^n)*x-I*Pi*a*b*d*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)*
x+ln(c)*a*b*e*x^2+1/4*Pi^2*b^2*e*x^2*csgn(I*c)*csgn(I*c*x^n)^5-1/8*Pi^2*b^2*e*x^2*csgn(I*x^n)^2*csgn(I*c*x^n)^
4-1/4*Pi^2*b^2*d*csgn(I*c)^2*csgn(I*c*x^n)^4*x+1/2*Pi^2*b^2*d*csgn(I*c)*csgn(I*c*x^n)^5*x-1/4*Pi^2*b^2*d*csgn(
I*x^n)^2*csgn(I*c*x^n)^4*x+1/2*Pi^2*b^2*d*csgn(I*x^n)*csgn(I*c*x^n)^5*x+1/4*Pi^2*b^2*e*x^2*csgn(I*x^n)*csgn(I*
c*x^n)^5-1/2*I*Pi*ln(c)*b^2*e*x^2*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 141, normalized size = 1.40 \begin {gather*} \frac {1}{2} \, b^{2} x^{2} e \log \left (c x^{n}\right )^{2} - \frac {1}{2} \, a b n x^{2} e + a b x^{2} e \log \left (c x^{n}\right ) + b^{2} d x \log \left (c x^{n}\right )^{2} - 2 \, a b d n x + \frac {1}{2} \, a^{2} x^{2} e + 2 \, a b d x \log \left (c x^{n}\right ) + 2 \, {\left (n^{2} x - n x \log \left (c x^{n}\right )\right )} b^{2} d + a^{2} d x + \frac {1}{4} \, {\left (n^{2} x^{2} - 2 \, n x^{2} \log \left (c x^{n}\right )\right )} b^{2} e \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2,x, algorithm="maxima")

[Out]

1/2*b^2*x^2*e*log(c*x^n)^2 - 1/2*a*b*n*x^2*e + a*b*x^2*e*log(c*x^n) + b^2*d*x*log(c*x^n)^2 - 2*a*b*d*n*x + 1/2
*a^2*x^2*e + 2*a*b*d*x*log(c*x^n) + 2*(n^2*x - n*x*log(c*x^n))*b^2*d + a^2*d*x + 1/4*(n^2*x^2 - 2*n*x^2*log(c*
x^n))*b^2*e

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 202 vs. \(2 (98) = 196\).
time = 0.35, size = 202, normalized size = 2.00 \begin {gather*} \frac {1}{4} \, {\left (b^{2} n^{2} - 2 \, a b n + 2 \, a^{2}\right )} x^{2} e + \frac {1}{2} \, {\left (b^{2} x^{2} e + 2 \, b^{2} d x\right )} \log \left (c\right )^{2} + \frac {1}{2} \, {\left (b^{2} n^{2} x^{2} e + 2 \, b^{2} d n^{2} x\right )} \log \left (x\right )^{2} + {\left (2 \, b^{2} d n^{2} - 2 \, a b d n + a^{2} d\right )} x - \frac {1}{2} \, {\left ({\left (b^{2} n - 2 \, a b\right )} x^{2} e + 4 \, {\left (b^{2} d n - a b d\right )} x\right )} \log \left (c\right ) - \frac {1}{2} \, {\left ({\left (b^{2} n^{2} - 2 \, a b n\right )} x^{2} e + 4 \, {\left (b^{2} d n^{2} - a b d n\right )} x - 2 \, {\left (b^{2} n x^{2} e + 2 \, b^{2} d n x\right )} \log \left (c\right )\right )} \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2,x, algorithm="fricas")

[Out]

1/4*(b^2*n^2 - 2*a*b*n + 2*a^2)*x^2*e + 1/2*(b^2*x^2*e + 2*b^2*d*x)*log(c)^2 + 1/2*(b^2*n^2*x^2*e + 2*b^2*d*n^
2*x)*log(x)^2 + (2*b^2*d*n^2 - 2*a*b*d*n + a^2*d)*x - 1/2*((b^2*n - 2*a*b)*x^2*e + 4*(b^2*d*n - a*b*d)*x)*log(
c) - 1/2*((b^2*n^2 - 2*a*b*n)*x^2*e + 4*(b^2*d*n^2 - a*b*d*n)*x - 2*(b^2*n*x^2*e + 2*b^2*d*n*x)*log(c))*log(x)

________________________________________________________________________________________

Sympy [A]
time = 0.21, size = 163, normalized size = 1.61 \begin {gather*} a^{2} d x + \frac {a^{2} e x^{2}}{2} - 2 a b d n x + 2 a b d x \log {\left (c x^{n} \right )} - \frac {a b e n x^{2}}{2} + a b e x^{2} \log {\left (c x^{n} \right )} + 2 b^{2} d n^{2} x - 2 b^{2} d n x \log {\left (c x^{n} \right )} + b^{2} d x \log {\left (c x^{n} \right )}^{2} + \frac {b^{2} e n^{2} x^{2}}{4} - \frac {b^{2} e n x^{2} \log {\left (c x^{n} \right )}}{2} + \frac {b^{2} e x^{2} \log {\left (c x^{n} \right )}^{2}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*ln(c*x**n))**2,x)

[Out]

a**2*d*x + a**2*e*x**2/2 - 2*a*b*d*n*x + 2*a*b*d*x*log(c*x**n) - a*b*e*n*x**2/2 + a*b*e*x**2*log(c*x**n) + 2*b
**2*d*n**2*x - 2*b**2*d*n*x*log(c*x**n) + b**2*d*x*log(c*x**n)**2 + b**2*e*n**2*x**2/4 - b**2*e*n*x**2*log(c*x
**n)/2 + b**2*e*x**2*log(c*x**n)**2/2

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 225 vs. \(2 (98) = 196\).
time = 4.09, size = 225, normalized size = 2.23 \begin {gather*} \frac {1}{2} \, b^{2} n^{2} x^{2} e \log \left (x\right )^{2} - \frac {1}{2} \, b^{2} n^{2} x^{2} e \log \left (x\right ) + b^{2} n x^{2} e \log \left (c\right ) \log \left (x\right ) + b^{2} d n^{2} x \log \left (x\right )^{2} + \frac {1}{4} \, b^{2} n^{2} x^{2} e - \frac {1}{2} \, b^{2} n x^{2} e \log \left (c\right ) + \frac {1}{2} \, b^{2} x^{2} e \log \left (c\right )^{2} - 2 \, b^{2} d n^{2} x \log \left (x\right ) + a b n x^{2} e \log \left (x\right ) + 2 \, b^{2} d n x \log \left (c\right ) \log \left (x\right ) + 2 \, b^{2} d n^{2} x - \frac {1}{2} \, a b n x^{2} e - 2 \, b^{2} d n x \log \left (c\right ) + a b x^{2} e \log \left (c\right ) + b^{2} d x \log \left (c\right )^{2} + 2 \, a b d n x \log \left (x\right ) - 2 \, a b d n x + \frac {1}{2} \, a^{2} x^{2} e + 2 \, a b d x \log \left (c\right ) + a^{2} d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2,x, algorithm="giac")

[Out]

1/2*b^2*n^2*x^2*e*log(x)^2 - 1/2*b^2*n^2*x^2*e*log(x) + b^2*n*x^2*e*log(c)*log(x) + b^2*d*n^2*x*log(x)^2 + 1/4
*b^2*n^2*x^2*e - 1/2*b^2*n*x^2*e*log(c) + 1/2*b^2*x^2*e*log(c)^2 - 2*b^2*d*n^2*x*log(x) + a*b*n*x^2*e*log(x) +
 2*b^2*d*n*x*log(c)*log(x) + 2*b^2*d*n^2*x - 1/2*a*b*n*x^2*e - 2*b^2*d*n*x*log(c) + a*b*x^2*e*log(c) + b^2*d*x
*log(c)^2 + 2*a*b*d*n*x*log(x) - 2*a*b*d*n*x + 1/2*a^2*x^2*e + 2*a*b*d*x*log(c) + a^2*d*x

________________________________________________________________________________________

Mupad [B]
time = 3.68, size = 104, normalized size = 1.03 \begin {gather*} \ln \left (c\,x^n\right )\,\left (\frac {b\,e\,\left (2\,a-b\,n\right )\,x^2}{2}+2\,b\,d\,\left (a-b\,n\right )\,x\right )+{\ln \left (c\,x^n\right )}^2\,\left (\frac {e\,b^2\,x^2}{2}+d\,b^2\,x\right )+\frac {e\,x^2\,\left (2\,a^2-2\,a\,b\,n+b^2\,n^2\right )}{4}+d\,x\,\left (a^2-2\,a\,b\,n+2\,b^2\,n^2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*log(c*x^n))^2*(d + e*x),x)

[Out]

log(c*x^n)*((b*e*x^2*(2*a - b*n))/2 + 2*b*d*x*(a - b*n)) + log(c*x^n)^2*((b^2*e*x^2)/2 + b^2*d*x) + (e*x^2*(2*
a^2 + b^2*n^2 - 2*a*b*n))/4 + d*x*(a^2 + 2*b^2*n^2 - 2*a*b*n)

________________________________________________________________________________________